<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
		<infopost-request>
			<xsl:for-each select="INSUREQ">
				<request-head>
					<trans-id>
						<xsl:value-of select="MAIN/TRANSRNO" />
					</trans-id>
					<trans-type>101</trans-type>
					<insu-id>
						<xsl:value-of select="MAIN/INSUID" />
					</insu-id>
					<trans-date>
						<xsl:value-of select="MAIN/TRANSRDATE" />
					</trans-date>
					<trans-time>
						<xsl:value-of select="MAIN/TRANSRTIME" />
					</trans-time>
					<area>
						<xsl:value-of select="MAIN/ZONENO" />
					</area>
					<bank>207</bank>
					<branch />
					<post>
						<xsl:value-of select="MAIN/BRNO" />
					</post>
					<agency-hand>
						<xsl:value-of select="MAIN/TELLERNO" />
					</agency-hand>
					<!--增加 column1 用来获取获取BRNM的值值 -->
					<column1>
						<xsl:value-of select="MAIN/BRNM" />
					</column1>
					<authorized />
				</request-head>
				<request-newbiz>
					<request-underwriting>
						<application>
							<apply-code>
								<xsl:value-of select="MAIN/APPLNO" />
							</apply-code>
							<apply-date>
								<xsl:value-of select="MAIN/TB_DATE" />
							</apply-date>
							<!--gao -->
							<!--营销员号 -->
							<agent-code>
								<xsl:value-of select="MAIN/SALE_ID" />
							</agent-code>
							<!--首期交费形式 -->
							<pay-mode>
								<xsl:choose>
									<xsl:when test="MAIN/NEXT_PAYWAY = 'T'">
										3
									</xsl:when>
									<xsl:when test="MAIN/NEXT_PAYWAY = 'V'">
										80
									</xsl:when>
									<xsl:when test="MAIN/NEXT_PAYWAY = 'K'">
										2
									</xsl:when>
									<xsl:when test="MAIN/NEXT_PAYWAY = 'P'">
										58
									</xsl:when>
									<xsl:when test="MAIN/NEXT_PAYWAY = 'C'">
										94
									</xsl:when>
									<xsl:otherwise />
								</xsl:choose>
							</pay-mode>
							<!--续期交费形式 -->
							<pay-next>
								<xsl:choose>
									<xsl:when test="MAIN/NEXT_PAYWAY = 'T'">
										3
									</xsl:when>
									<xsl:when test="MAIN/NEXT_PAYWAY = 'V'">
										80
									</xsl:when>
									<xsl:when test="MAIN/NEXT_PAYWAY = 'K'">
										2
									</xsl:when>
									<xsl:when test="MAIN/NEXT_PAYWAY = 'P'">
										58
									</xsl:when>
									<xsl:when test="MAIN/NEXT_PAYWAY = 'C'">
										94
									</xsl:when>
									<xsl:otherwise />
								</xsl:choose>
							</pay-next>
							<!--gao -->
							<validate-date />
							<sell-way>3</sell-way>
							<policy-type>3</policy-type>
							<group-single>2</group-single>
							<branch-bank />
							<agency-code>
								<xsl:value-of select="MAIN/BRNO" />
							</agency-code>
							<agency-hand>
								<xsl:value-of select="MAIN/TELLERNO" />
							</agency-hand>
							<agent-name />
							<bank-code>207</bank-code>
							<account-type>7</account-type>
							<account-name>
								<xsl:value-of select="TBR/TBR_NAME" />
							</account-name>
							<xsl:choose>
								<xsl:when test="MAIN/NEXT_PAYWAY = 'C'">
									<bank-account />
								</xsl:when>
								<xsl:otherwise>
									<bank-account>
										<xsl:value-of select="MAIN/PAYACC" />
									</bank-account>
								</xsl:otherwise>
							</xsl:choose>
							<overdue-manage>1</overdue-manage>
							<over-manage>2</over-manage>
							<deliver-type>4</deliver-type>
							<currency-code>1</currency-code>
							<assumpsit />
							<answer-type>1</answer-type>
							<answer-phone />
							<answer-assumpsit />
							<policy-pwd />
							<premium />
							<health-notice>
								<xsl:choose>
									<xsl:when test="HEALTH_NOTICE/NOTICE_ITEM = 'Y'">
										N
									</xsl:when>
									<xsl:otherwise>
										Y
									</xsl:otherwise>
								</xsl:choose>
							</health-notice>
							<column1 />
							<column2 />
							<column3 />
							<column4 />
							<column5 />
							<xsl:for-each select="TBR">
								<policy-holder>
									<real-name>
										<xsl:value-of select="TBR_NAME" />
									</real-name>
									<xsl:call-template name="GenderCode">
										<xsl:with-param name="srcCode" select="TBR_SEX" />
									</xsl:call-template>
									<birthday>
										<xsl:value-of select="TBR_BIRTH" />
									</birthday>
									<marriage-id />
									<nationality>
										<xsl:choose>
											<xsl:when test="TBR_IDTYPE = 1">
												37
											</xsl:when>
											<xsl:when test="TBR_IDTYPE = 2">
												37
											</xsl:when>
											<xsl:when test="TBR_IDTYPE = 4">
												37
											</xsl:when>
											<xsl:otherwise />
										</xsl:choose>
									</nationality>
									<race />
									<homeplace />
									<seat-address />
									<xsl:call-template name="CertiTypeCode">
										<xsl:with-param name="srcCode" select="TBR_IDTYPE" />
									</xsl:call-template>
									<certi-code>
										<xsl:value-of select="TBR_IDNO" />
									</certi-code>
									<certi-start-date />
									<certi-end-date>
										<xsl:value-of select="TBR_EFF_DATE" />
									</certi-end-date>
									<rela-address>
										<xsl:value-of select="TBR_ADDR" />
									</rela-address>
									<rela-zip>
										<xsl:value-of select="TBR_POSTCODE" />
									</rela-zip>
									<day-phone>
										<xsl:value-of select="TBR_TEL" />
									</day-phone>
									<!--应客户信息校验三期需要要求，固话不存固定电话2 -->
									<!--<night-phone> <xsl:value-of select="TBR_TEL"/> </night-phone> -->
									<night-phone />
									<celler>
										<xsl:value-of select="TBR_MOBILE" />
									</celler>
									<email>
										<xsl:value-of select="TBR_EMAIL" />
									</email>
									<pay-address>
										<xsl:value-of select="TBR_ADDR" />
									</pay-address>
									<pay-zip>
										<xsl:value-of select="TBR_POSTCODE" />
									</pay-zip>
									<job-address />
									<job-zip />
									<industy />
									<title />
									<job-name />
									<pt-job-name />
									<job-code>
										<xsl:value-of select="TBR_WORKTYPE" />
									</job-code>
									<xsl:choose>
										<xsl:when test="TBR_BBR_RELA = 1">
											<relation-with-main-insured>3</relation-with-main-insured>
										</xsl:when>
										<xsl:when test="TBR_BBR_RELA = 2">
											<relation-with-main-insured>10</relation-with-main-insured>
										</xsl:when>
										<xsl:when test="TBR_BBR_RELA = 3">
											<relation-with-main-insured>2</relation-with-main-insured>
										</xsl:when>
										<xsl:when test="TBR_BBR_RELA = 4">
											<relation-with-main-insured>14</relation-with-main-insured>
										</xsl:when>
										<xsl:when test="TBR_BBR_RELA = 5">
											<relation-with-main-insured>1</relation-with-main-insured>
										</xsl:when>
										<xsl:when test="TBR_BBR_RELA = 6">
											<relation-with-main-insured>7</relation-with-main-insured>
										</xsl:when>
										<xsl:when test="TBR_BBR_RELA = ''">
											<relation-with-main-insured />
										</xsl:when>
										<xsl:otherwise>
											<relation-with-main-insured>CODE_NOT_EXIST</relation-with-main-insured>
										</xsl:otherwise>
									</xsl:choose>
									<smoking>N</smoking>
									<yearly-income>
										<xsl:value-of select="TBR_INCOME" />
									</yearly-income>
									<social-security />
									<!--gao -->
									<!--投保人身高 -->
									<height>
										<xsl:value-of select="TBR_HEIGHT" />
									</height>
									<!--投保人体重 -->
									<weight>
										<xsl:value-of select="TBR_WEIGHT" />
									</weight>
									<!--投保人单位 -->
									<job-com>
										<xsl:value-of select="TBR_UNIT" />
									</job-com>
									<!--gao -->
									<!-- 增加column1用来获取TBR_HM的值 -->
									<column1>
										<xsl:value-of select="TBR_HM" />
									</column1>
									<!-- 增加column2用来获取TBR_TP的值 -->
									<column2>
										<xsl:value-of select="TBR_TP" />
									</column2>
								</policy-holder>
							</xsl:for-each>
							<life-assureds>
								<xsl:for-each select="BBR">
									<life-assured>
										<xsl:choose>
											<xsl:when test="/INSUREQ/TBR[1]/TBR_BBR_RELA = 5 and position()=1">
												<la-no>1</la-no>
												<xsl:choose>
													<xsl:when test="BBR_NAME = '' ">
														<real-name>
															<xsl:value-of select="/INSUREQ/TBR[1]/TBR_NAME" />
														</real-name>
													</xsl:when>
													<xsl:otherwise>
														<real-name>
															<xsl:value-of select="BBR_NAME" />
														</real-name>
													</xsl:otherwise>
												</xsl:choose>
												<xsl:choose>
													<xsl:when test="BBR_SEX = '' ">
														<xsl:call-template name="GenderCode">
															<xsl:with-param name="srcCode" select="/INSUREQ/TBR[1]/TBR_SEX" />
														</xsl:call-template>
													</xsl:when>
													<xsl:otherwise>
														<xsl:call-template name="GenderCode">
															<xsl:with-param name="srcCode" select="BBR_SEX" />
														</xsl:call-template>
													</xsl:otherwise>
												</xsl:choose>
												<xsl:choose>
													<xsl:when test="BBR_BIRTH = '' ">
														<birthday>
															<xsl:value-of select="/INSUREQ/TBR[1]/TBR_BIRTH" />
														</birthday>
													</xsl:when>
													<xsl:otherwise>
														<birthday>
															<xsl:value-of select="BBR_BIRTH" />
														</birthday>
													</xsl:otherwise>
												</xsl:choose>
												<marriage-id />
												<xsl:choose>
													<xsl:when test="BBR_IDTYPE = ''">
														<nationality>
															<xsl:choose>
																<xsl:when test="/INSUREQ/TBR[1]/TBR_IDTYPE = 1">
																	37
																</xsl:when>
																<xsl:when test="/INSUREQ/TBR[1]/TBR_IDTYPE = 2">
																	37
																</xsl:when>
																<xsl:when test="/INSUREQ/TBR[1]/TBR_IDTYPE = 4">
																	37
																</xsl:when>
																<xsl:otherwise />
															</xsl:choose>
														</nationality>
													</xsl:when>
													<xsl:otherwise>
														<nationality>
															<xsl:choose>
																<xsl:when test="BBR_IDTYPE = 1">
																	37
																</xsl:when>
																<xsl:when test="BBR_IDTYPE = 2">
																	37
																</xsl:when>
																<xsl:when test="BBR_IDTYPE = 4">
																	37
																</xsl:when>
																<xsl:otherwise />
															</xsl:choose>
														</nationality>
													</xsl:otherwise>
												</xsl:choose>
												<race />
												<homeplace />
												<seat-address />
												<xsl:choose>
													<xsl:when test="BBR_IDTYPE = '' ">
														<xsl:call-template name="CertiTypeCode">
															<xsl:with-param name="srcCode" select="/INSUREQ/TBR[1]/TBR_IDTYPE" />
														</xsl:call-template>
													</xsl:when>
													<xsl:otherwise>
														<xsl:call-template name="CertiTypeCode">
															<xsl:with-param name="srcCode" select="BBR_IDTYPE" />
														</xsl:call-template>
													</xsl:otherwise>
												</xsl:choose>
												<xsl:choose>
													<xsl:when test="BBR_IDNO = '' ">
														<certi-code>
															<xsl:value-of select="/INSUREQ/TBR[1]/TBR_IDNO" />
														</certi-code>
													</xsl:when>
													<xsl:otherwise>
														<certi-code>
															<xsl:value-of select="BBR_IDNO" />
														</certi-code>
													</xsl:otherwise>
												</xsl:choose>
												<certi-start-date />
												<certi-end-date>
													<xsl:value-of select="/INSUREQ/TBR[1]/TBR_EFF_DATE" />
												</certi-end-date>
												<rela-address>
													<xsl:value-of select="/INSUREQ/TBR[1]/TBR_ADDR" />
												</rela-address>
												<rela-zip>
													<xsl:value-of select="/INSUREQ/TBR[1]/TBR_POSTCODE" />
												</rela-zip>
												<!--应客户信息校验三期需求要求，固话不存固定电话2 -->
												<!--<night-phone> <xsl:value-of select="/INSUREQ/TBR[1]/TBR_TEL"/> </night-phone> -->
												<night-phone />
												<day-phone>
													<xsl:value-of select="/INSUREQ/TBR[1]/TBR_TEL" />
												</day-phone>
												<celler>
													<xsl:value-of select="/INSUREQ/TBR[1]/TBR_MOBILE" />
												</celler>
												<email>
													<xsl:value-of select="/INSUREQ/TBR[1]/TBR_EMAIL" />
												</email>
												<job-address />
												<job-zip />
												<industy />
												<title />
												<job-name />
												<pt-job-name />
												<!-- gao -->
												<!--被保人身高 -->
												<height>
													<xsl:value-of select="BBR_HEIGHT" />
												</height>
												<!--被保人体重 -->
												<weight>
													<xsl:value-of select="BBR_WEIGHT" />
												</weight>
												<!--被保人单位 -->
												<job-com>
													<xsl:value-of select="BBR_UNIT" />
												</job-com>
												<!-- gao -->
												<job-code>
													<xsl:value-of select="/INSUREQ/TBR[1]/TBR_WORKTYPE" />
												</job-code>
												<relation-with-policy-holder>1</relation-with-policy-holder>
												<relation-with-main-insured>1</relation-with-main-insured>
												<smoking>N</smoking>
												<yearly-income>
													<xsl:value-of select="/INSUREQ/TBR[1]/TBR_INCOME" />
												</yearly-income>
												<social-security />
											</xsl:when>
											<xsl:otherwise>
												<la-no>
													<xsl:number value="position()" />
												</la-no>
												<real-name>
													<xsl:value-of select="BBR_NAME" />
												</real-name>
												<xsl:call-template name="GenderCode">
													<xsl:with-param name="srcCode" select="BBR_SEX" />
												</xsl:call-template>
												<birthday>
													<xsl:value-of select="BBR_BIRTH" />
												</birthday>
												<marriage-id />
												<nationality>
													<xsl:choose>
														<xsl:when test="BBR_IDTYPE = 1">
															37
														</xsl:when>
														<xsl:when test="BBR_IDTYPE = 2">
															37
														</xsl:when>
														<xsl:when test="BBR_IDTYPE = 4">
															37
														</xsl:when>
														<xsl:otherwise />
													</xsl:choose>
												</nationality>
												<race />
												<homeplace />
												<seat-address />
												<xsl:call-template name="CertiTypeCode">
													<xsl:with-param name="srcCode" select="BBR_IDTYPE" />
												</xsl:call-template>
												<certi-code>
													<xsl:value-of select="BBR_IDNO" />
												</certi-code>
												<certi-start-date />
												<certi-end-date>
													<xsl:value-of select="BBR_EFF_DATE" />
												</certi-end-date>
												<rela-address>
													<xsl:value-of select="BBR_ADDR" />
												</rela-address>
												<rela-zip>
													<xsl:value-of select="BBR_POSTCODE" />
												</rela-zip>
												<!--应客户信息校验三期需求要求，固话不存固定电话2 -->
												<!--<night-phone> <xsl:value-of select="BBR_TEL"/> </night-phone> -->
												<night-phone />
												<day-phone>
													<xsl:value-of select="BBR_TEL" />
												</day-phone>
												<celler>
													<xsl:value-of select="BBR_MOBILE" />
												</celler>
												<email>
													<xsl:value-of select="BBR_EMAIL" />
												</email>
												<job-address />
												<job-zip />
												<industy />
												<title />
												<job-name />
												<pt-job-name />
												<!-- gao -->
												<!--被保人身高 -->
												<height>
													<xsl:value-of select="BBR_HEIGHT" />
												</height>
												<!--被保人体重 -->
												<weight>
													<xsl:value-of select="BBR_WEIGHT" />
												</weight>
												<!--被保人单位 -->
												<job-com>
													<xsl:value-of select="BBR_UNIT" />
												</job-com>
												<!-- gao -->
												<job-code>
													<xsl:value-of select="BBR_WORKTYPE" />
												</job-code>
												<xsl:choose>
													<xsl:when test="/INSUREQ/TBR/TBR_BBR_RELA = 1">
														<relation-with-policy-holder>
															<xsl:value-of select="3" />
														</relation-with-policy-holder>
													</xsl:when>
													<xsl:when test="/INSUREQ/TBR/TBR_BBR_RELA = 2">
														<relation-with-policy-holder>
															<xsl:value-of select="2" />
														</relation-with-policy-holder>
													</xsl:when>
													<xsl:when test="/INSUREQ/TBR/TBR_BBR_RELA = 3">
														<relation-with-policy-holder>
															<xsl:value-of select="10" />
														</relation-with-policy-holder>
													</xsl:when>
													<xsl:when test="/INSUREQ/TBR/TBR_BBR_RELA = 4">
														<relation-with-policy-holder>
															<xsl:value-of select="14" />
														</relation-with-policy-holder>
													</xsl:when>
													<xsl:when test="/INSUREQ/TBR/TBR_BBR_RELA = 5">
														<relation-with-policy-holder>
															<xsl:value-of select="1" />
														</relation-with-policy-holder>
													</xsl:when>
													<xsl:when test="/INSUREQ/TBR/TBR_BBR_RELA = 6">
														<relation-with-policy-holder>
															<xsl:value-of select="7" />
														</relation-with-policy-holder>
													</xsl:when>
													<xsl:when test="/INSUREQ/TBR/TBR_BBR_RELA = ''">
														<relation-with-policy-holder />
													</xsl:when>
													<xsl:otherwise>
														<relation-with-policy-holder>CODE_NOT_EXIST</relation-with-policy-holder>
													</xsl:otherwise>
												</xsl:choose>
												<relation-with-main-insured>1</relation-with-main-insured>
												<smoking>N</smoking>
												<yearly-income>
													<xsl:value-of select="BBR_INCOME" />
												</yearly-income>
												<social-security />
											</xsl:otherwise>
										</xsl:choose>
										<!-- 增加column1用来获取BBR_PROV -->
										<column1>
											<xsl:value-of select="BBR_PROV" />
										</column1>
										<!-- 增加colunm2用来获取BBR_CITY -->
										<column2>
											<xsl:value-of select="BBR_CITY" />
										</column2>
										<!-- 增加colunm3用来获取BBR_ED -->
										<!-- <column3> <xsl:value-of select="BBR_ED"/> </column3> -->
										<xsl:call-template name="EducationId">
											<xsl:with-param name="srcCode" select="BBR_ED" />
										</xsl:call-template>
									</life-assured>
								</xsl:for-each>
							</life-assureds>
							<beneficiaries>
								<xsl:for-each select="SYRS">
									<xsl:for-each select="SYR">
										<xsl:choose>
											<xsl:when test="SYR_TYPE = 1">
												<beneficiary>
													<xsl:choose>
														<xsl:when test="SYR_BBR_RELA = 5">
															<la-no>1</la-no>
														</xsl:when>
														<xsl:otherwise>
															<la-no>1</la-no>
														</xsl:otherwise>
													</xsl:choose>
													<xsl:choose>
														<xsl:when test="SYR_BBR_RELA = 5">
															<legal-bene-indi>Y</legal-bene-indi>
														</xsl:when>
														<xsl:otherwise>
															<legal-bene-indi>N</legal-bene-indi>
														</xsl:otherwise>
													</xsl:choose>
													<real-name>
														<xsl:value-of select="SYR_NAME" />
													</real-name>
													<xsl:call-template name="GenderCode">
														<xsl:with-param name="srcCode" select="SYR_SEX" />
													</xsl:call-template>
													<birthday>
														<xsl:value-of select="SYR_BIRTH" />
													</birthday>
													<xsl:call-template name="CertiTypeCode">
														<xsl:with-param name="srcCode" select="SYR_IDTYPE" />
													</xsl:call-template>
													<certi-code>
														<xsl:value-of select="SYR_IDNO" />
													</certi-code>
													<certi-start-date />
													<certi-end-date>
														<xsl:value-of select="SYR_EFF_DATE" />
													</certi-end-date>
													<nationality>
														<xsl:choose>
															<xsl:when test="SYR_IDTYPE = 1">
																37
															</xsl:when>
															<xsl:when test="SYR_IDTYPE = 2">
																37
															</xsl:when>
															<xsl:when test="SYR_IDTYPE = 4">
																37
															</xsl:when>
															<xsl:otherwise />
														</xsl:choose>
													</nationality>
													<bene-type>2</bene-type>
													<bene-order>
														<xsl:value-of select="SYR_ORDER" />
													</bene-order>
													<bene-rate>
														<xsl:value-of select="BNFT_PROFIT_PCENT" />
													</bene-rate>
													<!--gao -->
													<!-- <address/> -->
													<!-- 受益人地址 -->
													<address>
														<xsl:value-of select="SYR_ADDR" />
													</address>
													<!-- 受益人电话 -->
													<column1>
														<xsl:value-of select="SYR_TEL" />
													</column1>
													<!--受益人手机号码 -->
													<column2>
														<xsl:value-of select="SYR_MOBILE" />
													</column2>
													<!--gao -->
													<zip />
													<job-code />
													<xsl:choose>
														<xsl:when test="SYR_BBR_RELA = 1">
															<xsl:choose>
																<xsl:when test="SYR_SEX = '1'">
																	<relation-with-insured>2</relation-with-insured>
																</xsl:when>
																<xsl:when test="SYR_SEX = '2'">
																	<relation-with-insured>1</relation-with-insured>
																</xsl:when>
																<xsl:when test="SYR_SEX = '3'">
																	<relation-with-insured>2</relation-with-insured>
																</xsl:when>
															</xsl:choose>
														</xsl:when>
														<xsl:when test="SYR_BBR_RELA = 2">
															<xsl:choose>
																<xsl:when test="SYR_SEX = '1'">
																	<relation-with-insured>4</relation-with-insured>
																</xsl:when>
																<xsl:when test="SYR_SEX = '2'">
																	<relation-with-insured>5</relation-with-insured>
																</xsl:when>
																<xsl:when test="SYR_SEX = '3'">
																	<relation-with-insured>4</relation-with-insured>
																</xsl:when>
															</xsl:choose>
														</xsl:when>
														<xsl:when test="SYR_BBR_RELA = 3">
															<relation-with-insured>3</relation-with-insured>
														</xsl:when>
														<xsl:when test="SYR_BBR_RELA = 4">
															<relation-with-insured>15</relation-with-insured>
														</xsl:when>
														<xsl:when test="SYR_BBR_RELA = 5">
															<relation-with-insured>15</relation-with-insured>
														</xsl:when>
														<xsl:when test="SYR_BBR_RELA = 6">
															<relation-with-insured>15</relation-with-insured>
														</xsl:when>
														<xsl:when test="SYR_BBR_RELA = ''">
															<relation-with-insured />
														</xsl:when>
														<xsl:otherwise>
															<relation-with-insured>CODE_NOT_EXIST</relation-with-insured>
														</xsl:otherwise>
													</xsl:choose>
													<!--- bene-is-empty is added as check condition -->
													<xsl:choose>
														<xsl:when test="SYR_NAME='' and SYR_SEX='' and SYR_BBR_RELA='' and  SYR_IDTYPE='' and SYR_IDNO='' and SYR_BIRTH='' and SYR_ORDER='' and BNFT_PROFIT_PCENT=''">
															<bene-is-empty>Y</bene-is-empty>
														</xsl:when>
														<xsl:otherwise>
															<bene-is-empty>N</bene-is-empty>
														</xsl:otherwise>
													</xsl:choose>
												</beneficiary>
											</xsl:when>
										</xsl:choose>
									</xsl:for-each>
								</xsl:for-each>
							</beneficiaries>
							<xsl:for-each select="PRODUCTS">
								<products>
									<xsl:for-each select="PRODUCT">
										<product>
											<la-no>1</la-no>
											<product-num>100</product-num>
											<external-prd-code>
												<xsl:value-of select="PRODUCTID" />
											</external-prd-code>
											<product-name />
											<is-waiver>N</is-waiver>
											<waiver-num />
											<waiver-object />
											<charge-period>
												<xsl:value-of select="CHARGE_PERIOD" />
											</charge-period>
											<charge-year>
												<xsl:value-of select="CHARGE_YEAR" />
											</charge-year>
											<coverage-period>
												<xsl:value-of select="COVERAGE_PERIOD" />
											</coverage-period>
											<coverage-year>
												<xsl:value-of select="COVERAGE_YEAR" />
											</coverage-year>
											<charge-mode>
												<xsl:value-of select="PAYMETHOD" />
											</charge-mode>
											<pay-period />
											<pay-year />
											<end-period />
											<end-year />
											<pay-ensure />
											<pay-type />
											<amount>
												<xsl:value-of select="AMT" />
											</amount>
											<unit>
												<xsl:value-of select="AMT_UNIT" />
											</unit>
											<discount-prem>
												<xsl:if test=" PREMIUM != ''  ">
													<xsl:value-of select="PREMIUM div 100" />
												</xsl:if>
											</discount-prem>
											<count-way>2</count-way>
											<xsl:choose>
												<xsl:when test="DVDMETHOD = 0">
													<bonus-choice>1</bonus-choice>
												</xsl:when>
												<xsl:when test="DVDMETHOD = 1">
													<bonus-choice>2</bonus-choice>
												</xsl:when>
												<xsl:when test="DVDMETHOD = 2">
													<bonus-choice>3</bonus-choice>
												</xsl:when>
												<xsl:when test="DVDMETHOD = ''">
													<bonus-choice />
												</xsl:when>
												<xsl:otherwise>
													<bonus-choice>CODE_NOT_EXIST</bonus-choice>
												</xsl:otherwise>
											</xsl:choose>
											<xsl:choose>
												<xsl:when test="AMT = '' and AMT_UNIT='' ">
													<column1>Y</column1>
												</xsl:when>
												<xsl:otherwise>
													<column1>N</column1>
												</xsl:otherwise>
											</xsl:choose>
											<column2 />
											<column3 />
											<column4 />
											<column5 />
										</product>
									</xsl:for-each>
								</products>
							</xsl:for-each>
						</application>
					</request-underwriting>
				</request-newbiz>
			</xsl:for-each>
			<xsl:for-each select="INSUAFFIRM">
				<request-head>
					<trans-id>
						<xsl:value-of select="MAIN/TRANSRNO" />
					</trans-id>
					<trans-type>102</trans-type>
					<trans-date>
						<xsl:value-of select="MAIN/TRANSRDATE" />
					</trans-date>
					<trans-time>
						<xsl:value-of select="MAIN/TRANSRTIME" />
					</trans-time>
					<area>
						<xsl:value-of select="MAIN/ZONENO" />
					</area>
					<bank>207</bank>
					<branch />
					<post>
						<xsl:value-of select="MAIN/BRNO" />
					</post>
					<agency-hand>
						<xsl:value-of select="MAIN/TELLERNO" />
					</agency-hand>
					<authorized />
				</request-head>
				<request-newbiz>
					<request-policy-issue>
						<apply-code>
							<xsl:value-of select="MAIN/APPLNO" />
						</apply-code>
						<uw-trans-id>
							<xsl:value-of select="MAIN/REQSRNO" />
						</uw-trans-id>
						<invoice-code>
							<xsl:value-of select="MAIN/FP_PRINT_NO" />
						</invoice-code>
						<print-code>
							<xsl:value-of select="MAIN/BD_PRINT_NO" />
						</print-code>
						<premium>
							<xsl:if test=" MAIN/AMT_PREMIUM != '' ">
								<xsl:value-of select="MAIN/AMT_PREMIUM  div 100" />
							</xsl:if>
						</premium>
					</request-policy-issue>
				</request-newbiz>
			</xsl:for-each>
			<xsl:for-each select="INSU">
				<request-head>
					<trans-id>
						<xsl:value-of select="MAIN/TRANSRNO" />
					</trans-id>
					<trans-type>103</trans-type>
					<trans-date>
						<xsl:value-of select="MAIN/TRANSRDATE" />
					</trans-date>
					<trans-time>
						<xsl:value-of select="MAIN/TRANSRTIME" />
					</trans-time>
					<area>
						<xsl:value-of select="MAIN/ZONENO" />
					</area>
					<bank>207</bank>
					<branch />
					<post>
						<xsl:value-of select="MAIN/BRNO" />
					</post>
					<agency-hand>
						<xsl:value-of select="MAIN/TELLERNO" />
					</agency-hand>
					<authorized />
				</request-head>
				<request-policy-resend>
					<apply-code>
						<xsl:value-of select="MAIN/APPLNO" />
					</apply-code>
					<invoice-code />
					<print-code>
						<xsl:value-of select="MAIN/BD_PRINT_NO" />
					</print-code>
				</request-policy-resend>
			</xsl:for-each>
			<xsl:for-each select="FEETRANSCANC">
				<request-head>
					<trans-id>
						<xsl:value-of select="MAIN/TRANSRNO" />
					</trans-id>
					<trans-type>201</trans-type>
					<trans-date>
						<xsl:value-of select="MAIN/TRANSRDATE" />
					</trans-date>
					<trans-time>
						<xsl:value-of select="MAIN/TRANSRTIME" />
					</trans-time>
					<area>
						<xsl:value-of select="MAIN/ZONENO" />
					</area>
					<bank>207</bank>
					<branch />
					<post>
						<xsl:value-of select="MAIN/BRNO" />
					</post>
					<agency-hand>
						<xsl:value-of select="MAIN/TELLERNO" />
					</agency-hand>
					<authorized />
				</request-head>
				<request-intraday-cancel>
					<related-trans-id>
						<xsl:value-of select="MAIN/CORTRANSRNO" />
					</related-trans-id>
					<apply-code>
						<xsl:value-of select="MAIN/APPLNO" />
					</apply-code>
					<premium>
						<xsl:if test=" MAIN/PREMIUM != ''  ">
							<xsl:value-of select="MAIN/PREMIUM  div 100" />
						</xsl:if>
					</premium>
				</request-intraday-cancel>
			</xsl:for-each>
			<xsl:for-each select="FEEDAYCHECK">
				<request-head>
					<trans-id>
						<xsl:value-of select="MAIN/TRANSRNO" />
					</trans-id>
					<insu-id>
						<xsl:value-of select="MAIN/INSUID" />
					</insu-id>
					<trans-type>801</trans-type>
					<trans-date>
						<xsl:value-of select="MAIN/TRANSRDATE" />
					</trans-date>
					<trans-time>
						<xsl:value-of select="MAIN/TRANSRTIME" />
					</trans-time>
					<bank>207</bank>
					<area />
					<branch />
					<post />
					<agency-hand />
					<authorized />
				</request-head>
				<request-checkbill>
					<check-date>
						<xsl:value-of select="MAIN/CHECKDATE" />
					</check-date>
					<client-total-count>
						<xsl:value-of select="MAIN/TOTALCOUNT" />
					</client-total-count>
					<client-total-premium>
						<xsl:value-of select="MAIN/TOTALPREMIUM" />
					</client-total-premium>
					<check-trans-list>
						<xsl:for-each select="DAYCHECK_DETAILS/DAYCHECK_DETAIL">
							<check-trans>
								<sequence>
									<xsl:value-of select="sequence" />
								</sequence>
								<trans-date>
									<xsl:value-of select="trans-date" />
								</trans-date>
								<trans-time>
									<xsl:value-of select="trans-time" />
								</trans-time>
								<trans-id>
									<xsl:value-of select="trans-id" />
								</trans-id>
								<trans-area>
									<xsl:value-of select="trans-area" />
								</trans-area>
								<ph-name>
									<xsl:value-of select="ph-name" />
								</ph-name>
								<apply-code>
									<xsl:value-of select="apply-code" />
								</apply-code>
								<policy-code>
									<xsl:value-of select="policy-code" />
								</policy-code>
								<premium>
									<xsl:value-of select="premium" />
								</premium>
								<agency-hand>
									<xsl:value-of select="agency-hand" />
								</agency-hand>
								<xsl:choose>
									<xsl:when test="trans-type = 580001">
										<trans-type>102</trans-type>
									</xsl:when>
									<xsl:when test="trans-type = ''">
										<trans-type />
									</xsl:when>
									<xsl:otherwise>
										<trans-type>CODE_NOT_EXIST</trans-type>
									</xsl:otherwise>
								</xsl:choose>
							</check-trans>
						</xsl:for-each>
					</check-trans-list>
				</request-checkbill>
			</xsl:for-each>
		</infopost-request>
	</xsl:template>
	<xsl:template name="GenderCode">
		<xsl:param name="srcCode" />
		<xsl:choose>
			<xsl:when test="$srcCode = 1">
				<gender>M</gender>
			</xsl:when>
			<xsl:when test="$srcCode = 2">
				<gender>F</gender>
			</xsl:when>
			<xsl:when test="$srcCode = 3">
				<gender>N</gender>
			</xsl:when>
			<xsl:when test="$srcCode = ''">
				<gender />
			</xsl:when>
			<xsl:otherwise>
				<gender>CODE_NOT_EXIST</gender>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="CertiTypeCode">
		<xsl:param name="srcCode" />
		<xsl:choose>
			<xsl:when test="$srcCode = 1">
				<certi-type>1</certi-type>
			</xsl:when>
			<xsl:when test="$srcCode = 7">
				<certi-type>7</certi-type>
			</xsl:when>
			<xsl:when test="$srcCode = 2">
				<certi-type>2</certi-type>
			</xsl:when>
			<xsl:when test="$srcCode = 3">
				<certi-type>3</certi-type>
			</xsl:when>
			<xsl:when test="$srcCode = 4">
				<certi-type>4</certi-type>
			</xsl:when>
			<xsl:when test="$srcCode = 5">
				<certi-type>9</certi-type>
			</xsl:when>
			<xsl:when test="$srcCode = 6">
				<certi-type>6</certi-type>
			</xsl:when>
			<xsl:when test="$srcCode = ''">
				<certi-type />
			</xsl:when>
			<xsl:otherwise>
				<certi-type>CODE_NOT_EXIST</certi-type>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="EducationId">
		<xsl:param name="srcCode" />
		<xsl:choose>
			<xsl:when test="$srcCode = 1">
				<column3>8</column3>
			</xsl:when>
			<xsl:when test="$srcCode = 2">
				<column3>9</column3>
			</xsl:when>
			<xsl:when test="$srcCode = 3">
				<column3>7</column3>
			</xsl:when>
			<xsl:when test="$srcCode = 4">
				<column3>5</column3>
			</xsl:when>
			<xsl:when test="$srcCode = 5">
				<column3>4</column3>
			</xsl:when>
			<xsl:when test="$srcCode = 6">
				<column3>10</column3>
			</xsl:when>
			<xsl:when test="$srcCode = 7">
				<column3>2</column3>
			</xsl:when>
			<xsl:when test="$srcCode = 8">
				<column3>3</column3>
			</xsl:when>
			<xsl:when test="$srcCode = 9">
				<column3>11</column3>
			</xsl:when>
			<xsl:when test="$srcCode = 0">
				<column3>0</column3>
			</xsl:when>
			<xsl:when test="$srcCode = ''">
				<column3 />
			</xsl:when>
			<xsl:otherwise>
				<column3>CODE_NOT_EXIST</column3>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
</xsl:stylesheet>
